<!--
 * @Autor: Wei
 * @Date: 2020-04-20 14:34:48
 * @LastEditors: Wei
 * @LastEditTime: 2020-06-06 19:34:21
 -->
<template>
  <div>
    <div class="leftBox">
      <div class="headNav">
        <div
          class="headNavText"
          :class="{ selectHeadNav: isSelect == '推荐' }"
          @click="selectHeadNav('推荐')"
        >推荐</div>
        <div
          class="headNavText"
          :class="{ selectHeadNav: isSelect == '关注' }"
          @click="selectHeadNav('关注')"
        >关注</div>
        <div
          class="headNavText"
          :class="{ selectHeadNav: isSelect == '热榜' }"
          @click="selectHeadNav('热榜')"
        >热榜</div>
      </div>
      <el-divider></el-divider>

      <!-- // -->
      <recommend v-if="isSelect == '推荐'"></recommend>
      <attention v-if="isSelect == '关注'"></attention>
      <hot v-if="isSelect == '热榜'"></hot>
    </div>
  </div>
</template>

<script>
import recommend from "@/components/home/recommend/recommend";
import attention from "@/components/home/attention/attention";
import hot from "@/components/home/hot/hot";
export default {
  data() {
    return {
      isSelect: "推荐"
    };
  },
  components: {
    recommend,
    attention,
    hot
  },
  methods: {
    selectHeadNav(nav) {
      this.isSelect = nav;
    }
  }
};
</script>

<style lang="scss" scoped>
.leftBox {
  min-height: 300px;
  background: #fff;
  border-radius: 10px;
  padding: 20px;

  .headNav {
    display: flex;
    color: #6c6c6c;
    .headNavText {
      font-size: 22px;
      font-weight: 600;
      margin-right: 25px;
      cursor: pointer;
      &:hover {
        color: #1d2f70;
        font-weight: 600;
      }
    }
  }
}
//选中样式
.selectHeadNav {
  color: #1d2f70;
}
</style>
